<?php
/**
 * School Model
 *
 * Utilizes the Data Mapper pattern to persist data. Represents a single
 * school entry
 *
 * @version $Id: School.php 73 2010-04-25 00:30:44Z yingkuang.chen@gmail.com $
 * @license New BSD License
 * @uses School_Model_SchoolMapper
 * @package school
 * @subpackage Model
 */
class School_Model_School extends School_Model_Doctrine_BaseSchool
{

    private $_arrayData = array();
    /**
     * Constructor
     *
     * @param array|null $options
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
        $locale = Bootstrap::$config['resources']['locale']['default'];
        $path = dirname(__FILE__)."/../languages/$locale/data.ini";
        $ini = new Zend_Config_Ini($path);
        $this->_arrayData = $ini->get('array_data')->toArray();
    }

    public function getAttrArr()
    {
        return $this->_arrayData['attr'];
    }

    public function getYearName($id='')
    {
        if ($id)
        return ($this->_arrayData['year_name'][$id]);
        else
        return $this->_arrayData['year_name'];
    }
    public function getCountyArr()
    {
        return $this->_arrayData['county'];
        //return array("01"=>"台北市","02"=>"高雄市","03"=>"宜蘭縣","04"=>"基隆市","05"=>"台北縣","06"=>"桃園縣","07"=>"新竹縣","08"=>"新竹市","09"=>"苗栗縣","10"=>"台中縣","11"=>"台中市","12"=>"南投縣","13"=>"彰化縣","14"=>"雲林縣","15"=>"嘉義縣","16"=>"嘉義市","17"=>"台南縣","18"=>"台南市","19"=>"高雄縣","20"=>"屏東縣","21"=>"台東縣","22"=>"花蓮縣","23"=>"澎湖縣","24"=>"金門縣","25"=>"連江縣");
    }

    public function getMarkArr()
    {
        //return array('正常','廢校','停止招生');
        return $this->_arrayData['mark'];
    }

    public function getAreaArr()
    {
        //return array('一般地區','偏遠地區','特偏地區');
        return $this->_arrayData['area'];
    }

    public function getAttributeArr()
    {
        return array ("public"=>'public',"private"=>'private');
    }

    public function getYesNoArr()
    {
        return array("yes","no");
        //return array("是","否");
    }
}
